<template>
  <Spin :spinning="loading" tip="Loading...">
    <div>
      <!-- 旧件出库新增 - 车厂 - 详情页面 -->
      <BreakSpace label="出库信息" :containerStyle="{ marginBottom: '10px' }" />
      <FormPanel ref="formPanel1" :list="formList" :cols="3" :formType="'add'" labelWidth="90" :isSubmitBtn="false"
        @formChange="formChangeHandle" />
      <div style="padding-top: 3rem;"></div>

      <BreakSpace label="旧件列表" :containerStyle="{ marginBottom: '10px' }" />
      <FilterTable ref="table" :columns="columns" :params="fetchParams" :dataSource="dataList" :datakey="'items'"
        :onColumnsChange="columns => (this.columns = columns)" :onRowSelectChange="selectChange" selectionType="single"
        height="auto" :isPagination=false :isSelectColumn=false>
        <template slot="controls" slot-scope="props">
          <multiuse-button size="small" type="primary" icon="el-icon-plus" v-if="appId == 'beijing'"
            @click="downloadTemplate()">下载模板</multiuse-button>
          <multiuse-button size="small" type="primary" icon="el-icon-plus" v-if="appId == 'beijing'"
            @click="oldPartsImport()">导入</multiuse-button>
          <multiuse-button size="small" type="primary" icon="el-icon-plus" @click="add()">新增</multiuse-button>
        </template>
      </FilterTable>
      <!-- 旧件库存选择1 -->
      <BaseDialog :visible.sync="jiujianFlag" :title="'旧件选择'" destroyOnClose width="850px"
        :containerStyle="{ height: 'calc(100% - 60px)', overflow: 'auto', paddingBottom: '60px' }">
        <selectjiujian @close="jiujianclose" @save="saveMaintainItemSelect" :rowData="dataTypeValue" :rowType="PartType"
          :dataList='dataList'></selectjiujian>
      </BaseDialog>
      <!-- 旧件库存选择1 -->
      <BaseDialog :visible.sync="jiujianFlag1" :title="'旧件选择'" destroyOnClose width="850px"
        :containerStyle="{ height: 'calc(100% - 60px)', overflow: 'auto', paddingBottom: '60px' }">
        <selectjiujianOther @close="jiujianclose1" @save="saveMaintainItemSelect" :rowData="dataTypeValue"
          :rowType="PartType" :dataList='dataList'>
        </selectjiujianOther>
      </BaseDialog>
      <!-- 服务中心选择 -->
      <BaseDialog :visible.sync="selectDelearFlag" :title="'服务中心选择'" destroyOnClose
        :containerStyle="{ height: 'calc(100% - 60px)', overflow: 'auto', paddingBottom: '60px' }">
        <DealerList @close="suppliersClose" @save="suppliersSave"></DealerList>
      </BaseDialog>
      <!-- 供应商选择 -->
      <BaseDialog :visible.sync="suppliers" :title="'供应商选择'" destroyOnClose width="850px"
        :containerStyle="{ height: 'calc(100% - 60px)', overflow: 'auto', paddingBottom: '60px' }">
        <SupplierList @close="suppliersClose" @save="suppliersSave"></SupplierList>
      </BaseDialog>
      <BaseDialog :visible.sync="showImport" icon="el-icon-upload" :closable="false" title="导入" width="800px"
        destroyOnClose :containerStyle="{ height: 'calc(100% - 120px)', overflow: 'auto', paddingBottom: '60px' }">
        <importExcelOf @close="showImport = false" :digital="importData" @importclose="editsave()"
          url="/api/cms_claimfac/rPReturnDtl/importExcel" />
      </BaseDialog>
      <div style="margin-bottom: 1rem;"></div>
      <div style="padding-top: 3rem;"></div>
      <div :style="{
        position: 'fixed',
        left: 0,
        bottom: 0,
        right: 0,
        zIndex: 9,
        borderTop: '1px solid #e9e9e9',
        padding: '10px 20px',
        background: '#fff',
        textAlign: 'right'
      }">
        <!--      <multiuse-button type="primary" @click="">打 印</multiuse-button>-->
        <multiuse-button type="primary" :click="saveDialog.bind()">保 存</multiuse-button>
        <multiuse-button type="primary" :click="warehousing.bind()">出库</multiuse-button>
        <!--    <multiuse-button type="primary" :click="saveDialog2.bind()">出 库</multiuse-button> -->
        <multiuse-button @click="closeDialog">关 闭</multiuse-button>
      </div>
    </div>
  </Spin>
</template>
<script>
//手机号校验
import { phone } from '@/utils/validate';
//日期、时间控件默认值设置
import moment from 'moment';
import selectjiujian from './selectjiujian.vue';
import selectjiujianOther from './selectjiujianOther.vue';
//公共方法
import { getPartType, getSupplierList } from '@/api/dictionary/index.js';
import { newSave, exportTemplate, getOutNo } from '@/api/usedPartsReturnManage/usedPartsReturn_OEM/usedPartsOutOfStock';
//供应商
import SupplierList from '@/pages/claimDemage/tools/SuppliersList.vue';
import DealerList from '@/pages/claimDemage/tools/DealerList.vue';
import { dictionary } from '@/utils/dictMixin';
import { exportExcelFile } from '@/utils/index';
import importExcelOf from '@/pages/claimDemage/tools/importExcelOf.vue';
import { getAppId } from '@/assets/js/auth';
import fujiaxiangmulistVue from '../../../BasicData/ClaimApplication/fujiaxiangmulist.vue';
export default {
  mixins: [dictionary],
  components: {
    selectjiujian,
    selectjiujianOther,
    SupplierList,
    importExcelOf,
    DealerList,
  },
  data() {
    return {
      loading: false,
      editData: [],
      dataList: [],
      dealerData: [],
      visible: false,
      dataTypeValue: null,
      PartType: null,
      visibleDrawer: false,
      collapse: false,
      jiujianFlag: false,
      jiujianFlag1: false,
      columns: this.creatHeader(),
      fetchParams: {}, //ipa 接口
      selectedRows: [], //选中服务站
      formList: this.createFormList(),
      saveData: null,
      suppliers: false,
      supId: null,
      selectDelearFlag: false,
      supCode: null,
      showImport: false,
      importData: {},
      appId: getAppId()
    };
  },
  async created() {
    this.loading = true;
    await this.chuqi2();
    this.loading = false;
    let res = await getOutNo();
    //console.log('$$$$$$$$$$$$$$$$$$$$$$$', res.data)
    this.formList.find(x => x.fieldName == 'outNo').initialValue = res.data;

  },
  methods: {
    //出库类型下拉框
    async chuqi2() {
      console.log("===== 获取下拉框数据 ====== ")
      const res = await getPartType({ type: 5523 });
      console.log("==========", res)
      if (res.resultCode == 200) {
        this.formList.find(x => x.fieldName == 'outType').itemList = res.data.map(y => ({ text: y.codeCnDesc, value: y.codeId }));
      }
    },
    formChangeHandle(val) {
      console.log(val);
      this.saveData = val;
    },
    //选中
    selectChange(rows) {
      this.selectedRows = rows;
      console.log(this.selectedRows);
    },
    //取消操作
    closeDialog() {
      this.$emit('close', { visible: false, data: this.selectedRows, type: 'close' });
    },
    //服务站选择页面
    /*  SelectDelear() {
       this.selectDelearFlag = true;
     }, */
    //关闭
    /*  () {
       this.selectDelearFlag = false;
     },Delearclose */
    suppliersClose() {
      this.suppliers = false;
      this.selectDelearFlag = false
    },
    //供应商保存数据到上一层页面
    suppliersSave(obj) {
      if (this.formList.find(x => x.fieldName == 'outType').initialValue === 55231001) {
        this.formList.find(x => x.fieldName == 'supCode').initialValue = obj[0].dealerCode;
        this.formList.find(x => x.fieldName == 'supName').initialValue = obj[0].dealerName;
        this.supCode = obj[0].dealerCode;
        this.supId = obj[0].supId;
        this.selectDelearFlag = false
      }
      else if (this.formList.find(x => x.fieldName == 'outType').initialValue === 55231002) {
        this.formList.find(x => x.fieldName == 'supCode').initialValue = obj[0].supCode;
        this.formList.find(x => x.fieldName == 'supName').initialValue = obj[0].supName;
        this.supCode = obj[0].supCode;
        this.supId = obj[0].supId;
        this.suppliers = false;
      }
      else if (this.formList.find(x => x.fieldName == 'outType').initialValue === 55231003) {
        this.formList.find(x => x.fieldName == 'supCode').initialValue = obj[0].supCode;
        this.formList.find(x => x.fieldName == 'supName').initialValue = obj[0].supName;
        this.supCode = obj[0].supCode;
        this.supId = obj[0].supId;
        this.suppliers = false;
      }
    },
    selectSuppliersCode() {
      console.log("1111", this.formList.find(x => x.fieldName == 'outType'))
      if (this.formList.find(x => x.fieldName == 'outType').initialValue === 55231001) {// 服务中心
        this.selectDelearFlag = true
        this.formList.find(x => x.fieldName == 'supName').rules[0].required = true;
      } else if (this.formList.find(x => x.fieldName == 'outType').initialValue === 55231002) {// 供应商
        this.suppliers = true;
        this.formList.find(x => x.fieldName == 'supName').rules[0].required = true;
      } else if (this.formList.find(x => x.fieldName == 'outType').initialValue === 55231003) {// 供应商
        this.suppliers = true;
        this.formList.find(x => x.fieldName == 'supName').rules[0].required = false;
      } else if (this.formList.find(x => x.fieldName == 'outType').initialValue === 55231004) {  //报废，其他
        this.formList.find(x => x.fieldName == 'supName').rules[0].required = false;

      }
    },
    //删除
    deleteHandle(row) {
      this.$refs.table.$refs.pageTable.EXECUTE_DELETE([row]);
    },
    //保存
    async saveDialog() {
      let err = this.$refs.formPanel1.submitForm();
      if (err) {
        // this.$notify.error({ title: '提示信息', message: '请检查提交数据' });
        return;
      }
      console.log(this.saveData);
      console.log(this.dataList);
      if (!this.dataList || this.dataList.length == 0) {
        this.$notify.error({ title: '提示信息', message: '旧件列表不能为空' });
        return;
      }

      let bool = false;

      this.dataList.forEach(x => {
        if (bool) {
          return;
        }

        if (x.stockCount < x.outCount) {
          this.$notify.error({ title: '提示信息', message: '出库数量不能大于库存数量' });
          bool = true;
          return;
        }
        if (x.outCount <= 0 || x.outCount === null) {
          this.$notify.error({ title: '提示信息', message: '请输入正确的出库数量' });
          bool = true;
          return;
        }
        x.outCount = Number(x.outCount)
        x.partCount = x.stockCount
        x.partStatus = parseInt(x.partStatus)
      })
      if (bool) {
        return;
      }
      //console.log("this.formList.find(x => x.fieldName == 'partStatus').initialValue"+(this.formList.find(x => x.fieldName == 'partStatus').initialValue));
      let save = Object.assign({}, this.saveData, { dtlList: this.dataList },
        { isOutPart: 30151001 },
        { supCode: this.supCode },
        { partStatus: Number(this.formList.find(x => x.fieldName == 'partStatus').initialValue) },
        // {partStatus:parseInt(partStatus)},
        { outStatus: Number(this.formList.find(x => x.fieldName == 'partStatus').initialValue) }


      );
      //this.loading = true;
      let res = await newSave(save);
      if (res.resultCode === 200) {
        this.loading = false;
        this.$notify.success({ title: '提示信息', message: '保存成功!' });
        this.$emit('save');
      } else {
        this.loading = false;
        this.$notify.error({ title: '提示信息', message: res.errMsg || '保存失败!' });

      }
    },
    //出库
    async warehousing() {
      let err = this.$refs.formPanel1.submitForm();
      if (err) {
        // this.$notify.error({ title: '提示信息', message: '请检查提交数据' });
        return;
      }
      console.log(this.saveData);
      console.log(this.dataList);
      if (!this.dataList || this.dataList.length == 0) {
        this.$notify.error({ title: '提示信息', message: '旧件列表不能为空' });
        return;
      }

      let bool = false;
      this.dataList.forEach(x => {
        if (bool) {
          return;
        }

        if (x.stockCount < x.outCount) {
          this.$notify.error({ title: '提示信息', message: '出库数量不能大于库存数量' });
          bool = true;
          return;
        }
        if (x.outCount <= 0 || x.outCount === null) {
          this.$notify.error({ title: '提示信息', message: '请输入正确的出库数量' });
          bool = true;
          return;
        }
        x.outCount = Number(x.outCount)
        x.partCount = x.stockCount
        x.partStatus = parseInt(x.partStatus)
      })
      if (bool) {
        return;
      }

      let save = Object.assign({}, this.saveData, { dtlList: this.dataList },
        { isOutPart: 30151003 },
        { supCode: this.supCode },
        { outStatus: Number(this.dataList[0].partStatus) },
        { partStatus: Number(this.dataList.partStatus) }

      );
      //this.loading = true;
      let res = await newSave(save);
      if (res.resultCode === 200) {
        this.loading = false;
        this.$notify.success({ title: '提示信息', message: '出库成功!' });
        this.$emit('save');
      } else {
        this.loading = false;
        this.$notify.error({ title: '提示信息', message: res.errMsg || '出库失败!' });

      }
    },
    //子页面带回数据
    saveMaintainItemSelect(val) {
      console.log(val);
      this.editData = val;
      this.jiujianFlag = false;
      this.jiujianFlag1 = false;
      let list = [];
      this.dataList = [...this.dataList, ...val];
      // let pageList = this.$refs.table.$refs.pageTable.list;
      // val.map(x => {
      //   if (pageList.length == 0) {
      //     console.log("没有值，直接添加")
      //     x.outCount = ''
      //     pageList.push(x);
      //   } else {
      //     console.log("pageList", pageList)
      //     console.log("val", val)
      //     /* if (!pageList.find(f => f.hisId == x.hisId)) {
      //       console.log("11111")
      //       pageList.push(x);
      //     } */
      //    /*  if (pageList.find(f => f.partCode == x.partCode)) {
      //       return this.$notify.error({ title: '提示信息', message: '请选择不同的旧件代码进行添加' });
      //     }
      //     else { */
      //       console.log("11111")
      //       x.outCount = ''
      //       pageList.push(x);
      //     }

      // });
      // console.log("=====", list)
      // this.$refs.table.$refs.pageTable.EXECUTE_DELETE(this.$refs.table.$refs.pageTable.list);
      //this.$refs.table.$refs.pageTable.EXECUTE_INSERT(pageList);
      // this.fetchParams = { ...this.fetchParams };
      // list.map(f =>{
      //   console.log(f.cmsClaimNo);
      // delete f.pestructionCount;
      // delete f.partCount;
      // })
      // this.$refs.table1.$refs.pageTable.EXECUTE_DELETE(this.$refs.table1.$refs.pageTable.list);

    },
    SelectDelear() {
      this.selectDelearFlag = true;
    },
    //关闭
    /* Delearclose() {
      this.selectDelearFlag = false;
    }, */
    resetHandle(val) {
      this.dealerData = [];
      this.selectDealerData = [];
      this.fetchParams = Object.assign({}, this.fetchParams, val, { dealerCompanyCode: null }, { xhrAbort: false });
    },
    //保存
    /*    Delearsave(obj) {
         console.log('选择数据传递', obj);
         this.dealerData = obj;
         this.selectDealerData = [];
         obj.forEach(item => {
           this.selectDealerData.push(item.dealerCompanyCode);
         });
         this.selectDelearFlag = false;
       }, */
    chooseOrderNo() {
      this.visible = true;
    },
    add() {
      if (this.formList.find(x => x.fieldName == 'outType').initialValue === 55231001) {// 服务中心
        if (!this.formList.find(x => x.fieldName == 'supName').initialValue || !this.formList.find(x => x.fieldName == 'partStatus').initialValue) {
          return this.$notify.error({ title: '提示信息', message: '必选项不能为空值' });
        }
        else {
          this.jiujianFlag = true;
          this.dataTypeValue = this.formList.find(x => x.fieldName == 'supName').initialValue
          this.formList.find(x => x.fieldName == 'partStatus').disabled = true;
          this.formList.find(x => x.fieldName == 'partStatus').initialValue = '0'
          this.PartType = this.formList.find(x => x.fieldName == 'partStatus').initialValue;
          this.PartType = Number(this.PartType)
          console.log('part+++++++++++',this.PartType)
        }


      } else if (this.formList.find(x => x.fieldName == 'outType').initialValue === 55231002) {// 供应商
        if (!this.formList.find(x => x.fieldName == 'supName').initialValue || !this.formList.find(x => x.fieldName == 'partStatus').initialValue) {
          //console.log("!!!!!!!!!!")
          return this.$notify.error({ title: '提示信息', message: '必选项不能为空值' });
        } else {
          this.jiujianFlag1 = true;
          this.dataTypeValue = this.formList.find(x => x.fieldName == 'supName').initialValue
          this.formList.find(x => x.fieldName == 'partStatus').disabled = true;
          this.PartType = this.formList.find(x => x.fieldName == 'partStatus').initialValue;
          this.PartType = Number(this.PartType)
        }

      }
      else if (this.formList.find(x => x.fieldName == 'outType').initialValue === 55231003) {// 报废出库
        this.jiujianFlag1 = true;
        this.dataTypeValue = this.formList.find(x => x.fieldName == 'supName').initialValue
        this.formList.find(x => x.fieldName == 'partStatus').disabled = true;
        this.PartType = this.formList.find(x => x.fieldName == 'partStatus').initialValue;
        this.PartType = Number(this.PartType)
      }
      else {//报废，其他
        if (!this.formList.find(x => x.fieldName == 'partStatus').initialValue) {
          return this.$notify.error({ title: '提示信息', message: '必选项不能为空值' });
        } else {
          this.jiujianFlag1 = true;
          this.dataTypeValue = this.formList.find(x => x.fieldName == 'supName').initialValue

          this.formList.find(x => x.fieldName == 'partStatus').disabled = true;
        }
        this.PartType = this.formList.find(x => x.fieldName == 'partStatus').initialValue;
        this.PartType = Number(this.PartType)
      }
      /*  if (this.dataList.length > 0) {
         this.PartType = this.dataList[0].partStatus
         console.log('1111########', this.dataList[0].partStatus)
       } */
    },
    // 导入方法
    oldPartsImport() {
      let submitform = this.$refs.formPanel1.SUBMIT_FORM();
      console.log("校验返回数据", submitform);
      if (submitform == null) {
        return;
      }
      this.importData = submitform;
      this.showImport = true;
    },
    // 下载模板
    downloadTemplate() {
      this.$confirm('此操作将下载excel模板, 是否继续?', '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning'
      }).then(() => {
        this.exportLoading = true;
        exportTemplate().then(res => {
          console.log('666');
          console.log(res);
          exportExcelFile(res.data, '旧件出库导入模板');
          this.exportLoading = false;
        });
      });
    },



    editsave() {
      this.showImport = false;
      this.$emit("close", "");
      // this.fetchParams = {...this.fetchParams};
    },
    jiujianclose() {
      this.jiujianFlag = false;
    },
    jiujianclose1() {
      this.jiujianFlag1 = false;
    },
    createFormList() {
      return [
        {
          type: 'INPUT',
          label: '出库单号',
          fieldName: 'outNo',
          readonly: true,// 只读
          disabled: true // 置灰
        },
        {
          type: 'SELECT',
          label: '出库类型',
          fieldName: 'outType',
          placeholder: '请选择出库类型...',
          initialValue: 55231001,
          itemList: [],
          rules: [{ required: true, message: '请选择出库类型...', trigger: 'change' }],
          readonly: true,
          change: val => {
            this.formList.find(x => x.fieldName == 'supName').initialValue = '';
            //this.formList.find(x => x.fieldName == 'partStatus').initialValue = '';
            this.formList.find(x => x.fieldName == 'outType').initialValue = val;
            if (val == 55231001 ) {
              this.formList.find(x => x.fieldName == 'supName').rules[0].required = true;
              this.formList.find(x => x.fieldName == 'partStatus').initialValue = '0'
              this.formList.find(x => x.fieldName == 'partStatus').disabled = true
            } else if (val == 55231002 ) {
              this.formList.find(x => x.fieldName == 'supName').rules[0].required = true;
              this.formList.find(x => x.fieldName == 'partStatus').disabled = false
            } else {
              this.formList.find(x => x.fieldName == 'supName').rules[0].required = false;
              this.formList.find(x => x.fieldName == 'partStatus').disabled = false
            }
          }
        },
        /* {
          type: 'DATE',
          label: '出库日期',
          fieldName: 'outDate',

          // placeholder: '选择日期...',
          // initialValue: moment(new Date()).format('YYYY-MM-DD'),
          disabled: true // 置灰
          // rules: [{ required: true, message: '请选择日期', trigger: 'change' }]
        }, */

        /*    {
             type: 'INPUT',
             label: '服务中心',
             hidden:false,
             rules: [{required: true, message: '请选择服务中心...', trigger: 'blur',}],
             render: (p) => {
               return (
                 <div>
                   <el-select v-model={this.selectDealerData} disabled={true} multiple placeholder="请选择">
                     {this.dealerData.map((item) => (
                       <el-option key={item.dealerCode} label={item.dealerShortname} value={item.dealerCompanyCode} />
                     ))}
                   </el-select>
                   <multiuse-button style="position: absolute;right: 0;height:100%" icon="el-icon-search" onClick={() => this.selectDelearFlag = true} />
                 </div>
               );
             },
           }, */

        {
          type: 'INPUT',
          label: '供应商',
          fieldName: 'supCode',
          placeholder: '请选择供应商...',
          readonly: true,// 只读
          hidden: true,
          rules: [{ required: false, message: '请选择供应商...', trigger: 'blur', }],
          unitRender: p => {
            return (
              <div>
                <multiuse-button icon="el-icon-search" onClick={() => this.selectSuppliersCode()} />
              </div>
            );
          }
        },
        {
          type: 'INPUT',
          label: '供应商',
          fieldName: 'supName',
          placeholder: '请选择供应商...',
          readonly: true,// 只读
          // hidden:false,
          rules: [{ required: true, message: '请选择供应商...', trigger: 'blur', }],
          unitRender: p => {
            return (
              <div>
                <multiuse-button icon="el-icon-search" onClick={() => this.selectSuppliersCode()} />
              </div>
            );
          }
        },
        /*    {
             type: 'INPUT',
             label: '领件人',
             placeholder: '请输入领件人...',
             fieldName: 'outTo',
             rules: [{required: true, message: '请输入领件人...', trigger: 'change'}],
           },
           {
             type: 'INPUT',
             label: '联系电话',
             fieldName: 'outPhone',
             placeholder: '请输入联系电话...',
             rules: [{required: true, message: '请输入联系电话...', trigger: 'change'}, {pattern: /^1[2-9]\d{9}$/, message: '请检查联系电话格式...', trigger: 'blur',}],
           }, */
        {
          type: 'SELECT',
          label: '库存类型',
          fieldName: 'partStatus',
          placeholder: '请选择入库类型...',
          initialValue: '0',
          disabled: true,
          itemList: [{ text: '合格库', value: '1' }, { text: '不合格库', value: '0' }],
          rules: [{ required: true, message: '请选择库存类型', trigger: 'blur' }],
        },
        {
          type: 'TEXT_AREA',
          label: '备注',
          fieldName: 'outRemarks',
          placeholder: '请输入备注...',
          selfCols: 2,// 元素占据几行
          rows: 2
        }
      ];
    },

    //旧件列表
    creatHeader() {
      return [
        {
          title: '序号',
          dataIndex: 'index',
          width: 80,
          sorter: true,
          render: props => {
            return <span>{props.row.index + 1}</span>;
          }
        },
        {
          title: '操作',
          dataIndex: 'column-action',
          width: 100,
          render: (props) => {
            return (
              <div style="text-align:center">
                <multiuse-button size="mini" type="text" onClick={() => this.deleteHandle(props.row)}>
                  删除
                </multiuse-button>
              </div>
            );
          },
        },
        { title: 'rdId', dataIndex: 'rdId', sorter: true, hidden: true },
        /* {title: '索赔单号', dataIndex: 'cmsClaimNo', sorter: true},
         {title: '保修单号', dataIndex: 'roNo', sorter: true},
         {title: '供应商', dataIndex: 'supName', sorter: true}, */
        { title: '旧件代码', dataIndex: 'partCode', sorter: true },
        { title: '旧件名称', dataIndex: 'partName', sorter: true },
        { title: '库存数量', dataIndex: 'stockCount', sorter: true },
        {
          title: '出库数量',
          dataIndex: 'outCount',
          sorter: true,
          minWidth: 120,
          editable: true,
          defaultEditable: true,
          showOverflowTooltip: true,
          editType: 'number',
          editRequired: true,
          precision: 0,

          rules: [{ required: true, message: '请填写出库数量', trigger: 'blur' }]
        },
        /*   { title: '入库数量',
             dataIndex: 'inCount',
             sorter: true,
             minWidth: 120,
             editable: true,
             defaultEditable: true,
             showOverflowTooltip: true,
             precision: 0,
             editType: 'number',
             editRequired: true,
             placeholder: '请填写入库数量...',
             rules: [{ required: true, message: '请填写入库数量...', trigger: 'blur' }]
         } */
        /*  {title: 'VIN', dataIndex: 'vin', sorter: true},
         {title: '旧件ID', dataIndex: 'partId', sorter: true, hidden: true},
         {title: '旧件状态', dataIndex: 'partStatus', sorter: true, hidden: true},
         {title: '旧件状态', dataIndex: 'statusStr', sorter: true},
         {title: '索赔类型', dataIndex: 'cmsClaimTypeStr', sorter: true},
         {title: '入库日期', dataIndex: 'inStockDate', sorter: true, width: 140} */
      ];
    }
  }
};
</script>
<style lang="less" scoped>

</style>
